#pragma once
#include"ECS.h"
#include<set>
#include<YMath\Vector.h>
#include<YMath\Transform.h>
#include<memory>
#include<YDXRender\PayloadType.h>
#include <string>
namespace Component
{
	using namespace ECS;
	// system
	struct CameraComp
	{
		ECS_DEFINE_TYPE(CameraComp);

		// field of vertical
		// wo can get the height of near plane though NearPlane and FOV
		float FOV;

		// W/H
		// get width of near plane
		float AspecRatio;

		float NearPlane;
		float FarPlane;

		// Render target
		bool IsWirefire;
	};
	struct MeshRender
	{
		size_t meshHandle;
	};
	struct Transform
	{
		YXX::YMath::Float3 PositionL;
		YXX::YMath::Float3 RotationL;
		YXX::YMath::Float3 ScaleL;

		YXX::YMath::Float3 PositionW;
		YXX::YMath::Float3 RotationW;
		YXX::YMath::Float3 ScaleW;
	};
	struct SceneGraphComp
	{
		ECS_DEFINE_TYPE(SceneGraphComp);
		std::string name;
		Entity* Parent = nullptr;
		std::set<Entity*> Children;
	};

	struct SingleWorldSetting
	{
		// editor
		Entity* Selected;
	};
	// user stript
	struct CameraMove
	{
		float moveSpeed = 300.0f;
		float turnSpeed = 2.0f;

		ECS_DEFINE_TYPE(CameraMove);
	};

	Entity* CreateNewEntity(World* world);
	void CreateSingletonEntity(World* w);
}